# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-itemadapter
pkgver=0.8.0
pkgrel=1
pkgdesc="Common interface for data container classes"
url="https://github.com/scrapy/itemadapter"
license=('BSD')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-attrs' 'python-pydantic' 'python-pytest' 'scrapy')
source=("https://github.com/scrapy/itemadapter/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('86c688bef2d0add3f5ea2bd119689b076c5bc9f92edefb6f5d8faaf88023355e7d2ba5d683ce8f6acd24a2954c5a798902b30d0a70ca31dc32eb5245ad57953f')

build() {
  cd itemadapter-$pkgver
  python setup.py build
}

check() {
  cd itemadapter-$pkgver
  pytest
}

package() {
  cd itemadapter-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
